<template>
  <div>用户页</div>
  <div>
    <div>
      <h3>点击查看详情</h3>
      <el-button v-for="id in 3" :key="id" @click="goUserDetail(id)">查看详情用户 {{ id }}</el-button>
    </div>
    <div>
      <h3>详情</h3>
      <router-view />
    </div>
  </div>
</template>
<script setup lang="ts" name="TestUser">
import { computed } from "vue";
import { useRoute, useRouter } from "vue-router";

const router = useRouter();
const { push } = router;
const route = useRoute();
const fullPath = computed(() => {
  return route.fullPath;
});
const goUserDetail = function (id: number) {
  push({ path: "/test/user/" + id, query: { username: "lgc" + id } });
};
</script>

<style scoped></style>
